package com.twu.bm.football;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.PrintStream;

public class TeamListOption implements MenuOption {

    private PrintStream printStream;
    private BufferedReader reader;

    public TeamListOption(PrintStream printStream, BufferedReader reader) {
        this.printStream = printStream;
        this.reader = reader;
    }

    public void performAction() {
        String teamName = "";
        try {
        teamName = getTeamFromUser();
        } catch (IOException ex) {
            ex.printStackTrace();
        }
        printStream.println(teamName);
    }

    private String getTeamFromUser() throws IOException {
        printStream.println("Enter a team name:");
        return(reader.readLine());
    }
}
